#ifndef PEERNODESERVER_ROLE_H
#define PEERNODESERVER_ROLE_H

#include <QTcpServer>
#include <QObject>
#include <QString>
#include <QTcpSocket>

#include "tcp_meta.h"

class PeerNodeServerRole: public QTcpServer
{
    Q_OBJECT
public:
    PeerNodeServerRole(QObject *parent = 0, int port = 0);
    ~PeerNodeServerRole();

private slots:
    void connSockCheckdata();
    void connSockDisconnected();

protected slots:
    void acceptFileConnection();

protected:
    void incomingConnection(int socketDescriptor);

private:
    QTcpSocket *conn_socket;      /// 代表一个真实的 另外的客户端,
    void transfer(QString& filepath); ///传输文件
};

#endif // PEERNODESERVER_ROLE_H
